package com.itheima.reggie.service;

import com.itheima.reggie.entity.Dish;
import com.itheima.reggie.entity.Page;
import com.itheima.reggie.entity.R;
import com.itheima.reggie.entity.dto.DishDto;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

// @Transactional // 放在类上等同于该类的每个方法都放上了@Transactional
public interface DishService {
    @Transactional
    void save(DishDto dishDto);

    R<Page<DishDto>> findByPage(Integer page, Integer pageSize, String name);

    R<DishDto> findById(Long id);

    @Transactional
    void updateWithFlavor(DishDto dishDto);

    R<List<DishDto>> findByCategoryId(Long categoryId,Integer status);

    @Transactional
    void delete(Long[] ids);

    void updateStatus(List<Long> ids, int status);
}
